<?php
namespace app\controller;
use think\Request;
use think\View;
use app\model\Adv as AdvModel;

class H5
{
    // 预测页面
    public function index()
    {
        $azurl =  AdvModel::scope(function($query){
            $query->where('position','=',1)->limit(1);
        })->select();

        $iosurl =  AdvModel::scope(function($query){
            $query->where('position','=',1)->limit(1);
        })->select();
        $byurl =  AdvModel::scope(function($query){
            $query->where('position','=',3)->limit(1);
        })->select();

        $kfurl =  AdvModel::scope(function($query){
            $query->where('position','=',5)->limit(1);
        })->select();
        return view('index', [
                'azurl' =>  $azurl,
                'iosurl' =>  $iosurl,
                'byurl' => $byurl,
                'kfurl' =>  $kfurl
        ]);
    }

    public function urllist()
    {
        $adv    =   AdvModel::select();
        return view('urllist', [
                'adv' =>  $adv,

        ]);
    }
}
